class Squigly extends Piece;

var TwoDArray blockArray;

function setLeft() {
	setRight();
}

function setRight() {
	local int row, col;

	blockArray = new class'TwoDArray';
	blockArray.setDimensions(4,4);

	for(row=0; row < 4; row++){
		for(col=0; col < 4; col++){
			if (row == 0 && (col == 1 || col == 2)) {
				blockArray.set(row,col,1);
			}
			else if (row == 1 && (col == 0 || col == 1)) {
				blockArray.set(row,col,1);
			}
			else {
				blockArray.set(row,col, 0);
			}
		}
	}
}

function setDown() {
	setUp();
}

function setUp(){
//	PROBABILITY = 15;
	local int row, col;

	blockArray = new class'TwoDArray';
	blockArray.setDimensions(4,4);

	for(row=0; row < 4; row++){
		for(col=0; col < 4; col++){
			if (col == 0 && (row == 0 || row == 1)) {
				blockArray.set(row, col, 1);
			}
			else if (col == 1 && (row == 1 || row == 2)) {
				blockArray.set(row,col, 1);
			}
			else {
				blockArray.set(row,col, 0);
			}
		}
	}
}

function TwoDArray getCurrentBlockArray() {
	switch(super.getIndex()) {
		case 0:
			setUp();
			break;
		case 1: 
			setDown();
			break;
		case 2:
			setLeft();
			break;
		case 3:
			setRight();
			break;
		default:
			setUp();
	}
	return blockArray;
}
